/**
 * This program is free software, you can redistribute it and/or modify.
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * This file is a part of the CANN Open Software.
 * Licensed under CANN Open Software License Agreement Version 2.0 (the "License").
 * Please refer to the License for details. You may not use this file except in compliance with the License.
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
 * See LICENSE in the root of the software repository for the full text of the License.
 */

/* !
 * \file batch_mat_mul_v3_tiling_key.h
 * \brief
 */

#ifndef BATCH_MAT_MUL_V3_TILING_KEY_H
#define BATCH_MAT_MUL_V3_TILING_KEY_H

#include "ascendc/host_api/tiling/template_argument.h"

#define BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE 0
#define BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_TRUE 1

#define BATCH_MAT_MUL_V3_MULTI_BATCH_FALSE 0
#define BATCH_MAT_MUL_V3_MULTI_BATCH_TRUE 1

#define BATCH_MAT_MUL_V3_BASE_FULLLOAD 0
#define BATCH_MAT_MUL_V3_AL1_FULLLOAD 1
#define BATCH_MAT_MUL_V3_BL1_FULLLOAD 2

#define BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE 0
#define BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_TRUE 1

#define BATCH_MAT_MUL_V3_MIXND2NZ_TRUE 0
#define BATCH_MAT_MUL_V3_MIXND2NZ_FALSE 1

ASCENDC_TPL_ARGS_DECL(
    BatchMatMulV3,
    ASCENDC_TPL_UINT_DECL(
        MULTIBATCHL1FULLLOAD, ASCENDC_TPL_4_BW, ASCENDC_TPL_UI_LIST,
        BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_TRUE),
    ASCENDC_TPL_UINT_DECL(
        MULTIBATCH, ASCENDC_TPL_4_BW, ASCENDC_TPL_UI_LIST,
        BATCH_MAT_MUL_V3_MULTI_BATCH_FALSE, BATCH_MAT_MUL_V3_MULTI_BATCH_TRUE),
    ASCENDC_TPL_UINT_DECL(
        LOADMODE, ASCENDC_TPL_4_BW, ASCENDC_TPL_UI_LIST,
        BATCH_MAT_MUL_V3_BASE_FULLLOAD, BATCH_MAT_MUL_V3_AL1_FULLLOAD, BATCH_MAT_MUL_V3_BL1_FULLLOAD),
    ASCENDC_TPL_UINT_DECL(
        ISMULTIBATCHOUT, ASCENDC_TPL_4_BW, ASCENDC_TPL_UI_LIST,
        BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_TRUE),
    ASCENDC_TPL_UINT_DECL(
        MIXND2NZ, ASCENDC_TPL_4_BW, ASCENDC_TPL_UI_LIST,
        BATCH_MAT_MUL_V3_MIXND2NZ_TRUE, BATCH_MAT_MUL_V3_MIXND2NZ_FALSE), );

#if defined(__CCE_AICORE__) && __CCE_AICORE__ < 220
ASCENDC_TPL_SEL(
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_FALSE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_BASE_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_FALSE), ),
);
#else
ASCENDC_TPL_SEL(
    /* Common */
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY),
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_FALSE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_BASE_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_FALSE), ),
    /* UnAlignCommon */
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_MIX_AIC_1_2),
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_FALSE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_BASE_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_TRUE), ),
    /* AL1_FULLLOAD */
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY),
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_FALSE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_AL1_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_FALSE), ),
    /* BL1_FULLLOAD */
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY),
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_FALSE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_BL1_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_FALSE), ),
    /* MultiBatchOut */
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_MIX_AIC_1_2),
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_TRUE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_BASE_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_TRUE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_TRUE), ),
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY),
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_TRUE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_BASE_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_TRUE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_FALSE), ),
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_MIX_AIC_1_2),
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_TRUE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_BASE_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_TRUE), ),
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY),
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_FALSE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_TRUE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_BASE_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_FALSE), ),
    /* MultiBatchL1_FULLLOAD */
    ASCENDC_TPL_ARGS_SEL(
        ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY),
        ASCENDC_TPL_UINT_SEL(MULTIBATCHL1FULLLOAD, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_L1_FULLLOAD_TRUE),
        ASCENDC_TPL_UINT_SEL(MULTIBATCH, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MULTI_BATCH_FALSE),
        ASCENDC_TPL_UINT_SEL(LOADMODE, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_BASE_FULLLOAD),
        ASCENDC_TPL_UINT_SEL(ISMULTIBATCHOUT, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_ISMULTIBATCHOUT_FALSE),
        ASCENDC_TPL_UINT_SEL(MIXND2NZ, ASCENDC_TPL_UI_LIST, BATCH_MAT_MUL_V3_MIXND2NZ_FALSE), ), );

#endif

#endif // BATCH_MAT_MUL_V3_TILING_KEY_H